package com.crayfish.quduo.utils;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.crayfish.quduo.R;

/**
 * Created by crayfish on 2016/12/29.
 */
public class ImageUtil {
    public static void imageGifLoad(Context mContext, String url, ImageView imageView){
        Glide.with(mContext)
                .load(url)
                .asGif()
                .diskCacheStrategy(DiskCacheStrategy.SOURCE)
                .placeholder(R.mipmap.empty)
                .error(R.mipmap.error)
                .into(imageView);
    }

    public static void imageBitmapLoad(Context mContext, String url, ImageView imageView){
        Glide.with(mContext)
                .load(url)
                .asBitmap()
                .placeholder(R.mipmap.empty)
                .error(R.mipmap.error)
                .into(imageView);
    }
}
